import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app_1_25_0/testWidget/custom_input_cell.dart';
import 'package:flutter_app_1_25_0/testWidget/image/image_view.dart';
import 'package:websafe_svg/websafe_svg.dart';

class ReportPage extends StatefulWidget {
  ReportPage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _ReportPageState createState() => _ReportPageState();
}

class _ReportPageState extends State<ReportPage> {
  Widget svgFromAsset(
    String asset, {
    Alignment alignment = Alignment.center,
    Color color,
    bool excludeFromSemantics = false,
    BoxFit fit = BoxFit.contain,
    double height,
    Key key,
    String package,
    WidgetBuilder placeholderBuilder,
    String semanticsLabel,
    double width,
    ImageFrameBuilder frameBuilder,
  }) {
    return WebsafeSvg.asset(
      asset,
      // alignment: alignment,
      color: color,
      fit: fit,
      height: height,
      package: package,
      width: width,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Container(
          color: Colors.green,
          width: flexible(context, 860.0),
          child: Column(
            children: [
              Stack(
                children: [
                  Container(
                    color: Colors.redAccent,
                    width: flexible(context, 860.0),
                    height: flexible(context, 150),
                    child: svgFromAsset(
                      'assets/svg/study_card_background.svg',
                      // imageUrl: 'assets/1.jpg',
                      width: double.infinity,
                      height: flexible(context, 150.0),
                      fit: BoxFit.contain,
                      // package: 'ui_component',
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: flexible(context, 10.0)),
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
